<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<?php
  require_once('system/dbConnect.php');
  require_once('system/MyFunc.php');  
  $username = $_POST["username"];
  $pwd = $_POST["pwd"];
  //连接数据库  
  connect();
  //编写sql语句
  $sql = "select * from admins where adminname='".$username."' and password='".$pwd."'"; 
   //echo $sql."<br/>";
  $result = mysql_query($sql) or die('查询失败！'.mysql_error());
 
  //判断是否合法用户，如果是合法用户，则转向用户列表页面，否则转向登录页面
  $num = mysql_num_rows($result);
  if($num>0){	 
	  //3秒后转向用户列表页面
	  redirect('videoList.php', '登录成功!');
	  //header("location:userList.php");	
  }else{
	  redirect('login.html', '用户名或密码错误！请重新登录！');	  
	  //header("location:login.html");	  
  } 
?>
</body>
</html>

